package com.wnhz.work.yz.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBHelper extends SQLiteOpenHelper {
    public DBHelper(Context context) {
        super(context, "yz.db", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.e("------", "建表并插入数据");
        db.execSQL("CREATE TABLE 'project' (\n" +
                "  'project_id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +
                "  'orderid' varchar(100) DEFAULT \"\",\n" +
                "  'address' varchar(100) DEFAULT \"\",\n" +
                "  'install' varchar(100) DEFAULT \"\",\n" +
                "  'check_time' varchar(100) DEFAULT \"\",\n" +
                "  'all_nums' varchar(100) DEFAULT \"\",\n" +
                "  'has_nums' varchar(1000) DEFAULT \"\",\n" +
                "  'project_name' varchar(1000) DEFAULT \"\",\n" +
                "  'budget_no' varchar(1000) DEFAULT \"\",\n" +
                "  'img' varchar(2000) DEFAULT \"\"\n" +
                ")");

        db.execSQL("CREATE TABLE 'product' (\n" +
                " 'product_id'  INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +
                " 'project_id'  varchar(100) DEFAULT \"\",\n" +
                "  'status' varchar(100) DEFAULT \"\",\n" +
                "  'company' varchar(100) DEFAULT \"\",\n" +
                "  'name' varchar(100) DEFAULT \"\",\n" +
                "  'score' varchar(100) DEFAULT \"\",\n" +
                "  'img' varchar(2000) DEFAULT \"\",\n" +
                "  'number' varchar(100) DEFAULT \"\",\n" +
                "  'pid' varchar(1000) DEFAULT \"\",\n" +
                "  'house' varchar(100) DEFAULT \"\",\n" +
                "  'type' varchar(100) DEFAULT \"\",\n" +
                "  'info' varchar(100) DEFAULT \"\"\n" +
                "  \n" +
                ")");
        db.execSQL("CREATE TABLE 'zhuti' (\n" +
                " 'zhuti_id'  INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +
                " 'sum'  varchar(100) DEFAULT \"\",\n" +
                "  'label' varchar(100) DEFAULT \"\"\n" +
                " \n" +
                ")");
        db.execSQL("CREATE TABLE 'zhuti_item' (\n" +
                " 'zhuti_item_id'  INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +
                " 'zhuti_id'  varchar(100) DEFAULT \"\",\n" +
                "  'is_punish' varchar(100) DEFAULT \"\",\n" +
                "  'score' varchar(100) DEFAULT \"\",\n" +
                "  'img' varchar(2000) DEFAULT \"\",\n" +
                "  'pid' varchar(100) DEFAULT \"\",\n" +
                "  'type' varchar(100) DEFAULT \"\",\n" +
                "  'status' varchar(100) DEFAULT \"\",\n" +
                "  'name' varchar(100) DEFAULT \"\"\n" +
                " \n" +
                ")");

        db.execSQL("CREATE TABLE 'show' (\n" +
                " 'show_id'  INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +
                " 'zhuti_item_id'  varchar(100) DEFAULT \"\",\n" +
                "  'contract_id' varchar(100) DEFAULT \"\",\n" +
                "  'budget_no' varchar(100) DEFAULT \"\",\n" +
                "  'img' varchar(2000) DEFAULT \"\",\n" +
                "  'name' varchar(100) DEFAULT \"\",\n" +
                "  'info' varchar(100) DEFAULT \"\",\n" +
                "  'label' varchar(100) DEFAULT \"\",\n" +
                "  'install' varchar(100) DEFAULT \"\",\n" +
                "  'score' varchar(100) DEFAULT \"\",\n" +
                "  'status' varchar(100) DEFAULT \"\",\n" +
                "  'remark' varchar(100) DEFAULT \"\",\n" +
                "  'check_time' varchar(100) DEFAULT \"\", \n" +
                "  'check_img' varchar(2000) DEFAULT \"\"\n" +
                " \n" +
                ")");
        // db.execSQL("insert into person (name) values ('Tom')");
    }

    //升级时调用的方法
    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {

    }
}
